/* 
* This module is part of the Entertainment Network system 
* Copyright (c) SCC Soft Computer, Inc. 2018 
* All Rights Reserved 
* 
* This document contains unpublished, confidential and proprietary 
* information of SCC Soft Computer, Inc. No disclosure or use of 
* any portion of the contents of these materials may be made without the 
* express written consent of Soft Computer Consultants, Inc. 
* 
*/ 

package isd.dp.ua.EntertainmentNetworkServer.Models;
// Generated Feb 9, 2018 5:32:55 PM by Hibernate Tools 3.5.0.Final

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.*;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

import isd.dp.ua.EntertainmentNetworkServer.Common.BaseModel;

/**
 * City generated by hbm2java
 */

@SuppressWarnings("serial")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType
@Entity
@Table(name = "CITY", schema = "PBAB")
public class City  extends BaseModel implements java.io.Serializable
{
	private BigDecimal citId;
	private String citName;
	private String citCountry;
	private Set<Cinema> cinemas = new HashSet<Cinema>(0);

	public City()
	{
	}

	public City(BigDecimal citId, String citName, String citCountry)
	{
		this.citId = citId;
		this.citName = citName;
		this.citCountry = citCountry;
	}

	public City(BigDecimal citId, String citName, String citCountry, Set<Cinema> cinemas)
	{
		this.citId = citId;
		this.citName = citName;
		this.citCountry = citCountry;
		this.cinemas = cinemas;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CITY_SEQ")
    @SequenceGenerator(name = "CITY_SEQ", sequenceName = "CITY_SEQ")
	@Column(name = "CIT_ID", unique = true, nullable = false, precision = 22, scale = 0)
	public BigDecimal getCitId()
	{
		return this.citId;
	}

	public void setCitId(BigDecimal citId)
	{
		this.citId = citId;
	}

	@Column(name = "CIT_NAME", nullable = false, length = 100)
	public String getCitName()
	{
		return this.citName;
	}

	public void setCitName(String citName)
	{
		this.citName = citName;
	}

	@Column(name = "CIT_COUNTRY", nullable = false, length = 100)
	public String getCitCountry()
	{
		return this.citCountry;
	}

	public void setCitCountry(String citCountry)
	{
		this.citCountry = citCountry;
	}

	@OneToMany(cascade={CascadeType.MERGE}, fetch = FetchType.EAGER, mappedBy = "city")
	public Set<Cinema> getCinemas()
	{
		return this.cinemas;
	}

	public void setCinemas(Set<Cinema> cinemas)
	{
		this.cinemas = cinemas;
	}

	@Override
	public String toString()
	{
		return "City [citId=" + citId + ", citName=" + citName + "]";
	}
}
